package com.wanxi.properties;

import com.wanxi.util.Tool;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import java.util.Set;

public class MyPropertiesInputReader {
    public static void main(String[] args) {
        Properties properties = new Properties();
        String path = "E:\\wanxi\\step-2\\java02-0921\\day21OtherIOStream\\src\\com\\wanxi\\properties";
        String fileName = "a.txt";
        InputStream inputStream = Tool.getInputStream(path, fileName);

        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        Set<Object> keys = properties.keySet();
        for (Object key : keys
        ) {
            System.out.println(key + "=" + properties.get(key));
        }
    }
}
